import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
import { WsMgr } from './TCP/WsMgr';
const { ccclass, property } = _decorator;

@ccclass('TableMode')
export class TableMode extends Component {
    @property({ type: SpriteFrame })
    table1Bg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1Add: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1Minus: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1ScoreBg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1BarBg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1Score: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table1GameDesc: SpriteFrame = null;


    @property({ type: SpriteFrame })
    table2Bg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2Add: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2Minus: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2ScoreBg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2BarBg: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2Score: SpriteFrame = null;
    @property({ type: SpriteFrame })
    table2GameDesc: SpriteFrame = null;


    @property({ type: Sprite })
    tableBg: Sprite = null;
    @property({ type: Sprite })
    tableAdd: Sprite = null;
    @property({ type: Sprite })
    tableMinus: Sprite = null;
    @property({ type: Sprite })
    tableScoreBg: Sprite = null;
    @property({ type: Sprite })
    tableBarBg: Sprite = null;
    @property({ type: Sprite })
    tableScore: Sprite = null;
    @property({ type: Sprite })
    gameDesc: Sprite = null;

   

   loadModel(type:number){
   
        if (type==1) {
            this.tableBg.spriteFrame=this.table1Bg;
            this.tableAdd .spriteFrame=  this.table1Add;
            this.tableMinus .spriteFrame=  this.table1Minus;
            this.tableScoreBg .spriteFrame=  this.table1ScoreBg;
            this.tableBarBg .spriteFrame=  this.table1BarBg;
            this.tableScore .spriteFrame=  this.table1Score;
            this.gameDesc .spriteFrame=  this.table1GameDesc;
        }
            
        if (type==2) {
            this.tableBg.spriteFrame=this.table2Bg;
            this.tableAdd .spriteFrame=  this.table2Add;
            this.tableMinus .spriteFrame=  this.table2Minus;
            this.tableScoreBg .spriteFrame=  this.table2ScoreBg;
            this.tableBarBg .spriteFrame=  this.table2BarBg;
            this.tableScore .spriteFrame=  this.table2Score;
            this.gameDesc .spriteFrame=  this.table2GameDesc;
        }
        
    
   }




    
}


